<%@ Page Title="Sys_Bank Item" Language="C#" AutoEventWireup="true" CodeBehind="Sys_BankItem.aspx.cs" Inherits="Youz.CreditRepay.Manage.Sys_BankItem" %>
<script>
    //loadCSS("UIResources/Scripts/jquery.validate/valid.css");

    var requireJS = [
        //"assets/js/jquery.form.js"
    ];
    loadJS(requireJS);
</script><div class="row"><div class="col-lg-12"><div class="panel panel-default"><div class="panel-heading"><h2><i class="fa fa-edit"></i><%: R(LanguageModule.Sys_Bank, "Sys_Bank", "Sys_Bank") %></h2></div><div class="panel-body"><form id="frm" class="form-horizontal" method="post" enctype="multipart/form-data" action="Right/Handlers/Sys_BankHandler.ashx?type=save"><input id="ID" name="ID" type="hidden" />
<div class="form-group">
<label class="control-label" for="Code"><%: R(LanguageModule.Sys_Bank, "Code", "Code") %></label>
<div class="controls"><input type="text" id="Code" name="Code" maxlength="20" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="Name"><%: R(LanguageModule.Sys_Bank, "Name", "Name") %></label>
<div class="controls"><input type="text" id="Name" name="Name" maxlength="100" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="NameAbbr"><%: R(LanguageModule.Sys_Bank, "NameAbbr", "NameAbbr") %></label>
<div class="controls"><input type="text" id="NameAbbr" name="NameAbbr" maxlength="100" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="Type"><%: R(LanguageModule.Sys_Bank, "Type", "Type") %></label>
<div class="controls"><input type="text" id="Type" name="Type" maxlength="4" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="Sort"><%: R(LanguageModule.Sys_Bank, "Sort", "Sort") %></label>
<div class="controls"><input type="text" id="Sort" name="Sort" maxlength="4" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="Limit"><%: R(LanguageModule.Sys_Bank, "Limit", "Limit") %></label>
<div class="controls"><input type="text" id="Limit" name="Limit" maxlength="9" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="CreatedOn"><%: R(LanguageModule.Sys_Bank, "CreatedOn", "CreatedOn") %></label>
<div class="controls"><input type="text" id="CreatedOn" name="CreatedOn" maxlength="8" class="form-control" /></div>
</div>
<div class="form-group">
<label class="control-label" for="ModifiedOn"><%: R(LanguageModule.Sys_Bank, "ModifiedOn", "ModifiedOn") %></label>
<div class="controls"><input type="text" id="ModifiedOn" name="ModifiedOn" maxlength="8" class="form-control" /></div>
</div>
<div class="alert alert-danger" style="display: none;"><button type="button" class="close" data-dismiss="alert">×</button><strong>Oh snap!</strong><span class="content"></span></div><div class="form-actions"><button class="btn btn-success" type="submit" id="btnSubmit"><%: R(LanguageModule.M_Common, "btnSubmit", "保存修改") %></button>
						<button class="btn btn-default" type="button" id="btnCancel"><%: R(LanguageModule.M_Common, "btnCancel", "取消") %></button></div></form></div></div></div></div><script type="text/javascript">

    var flag = false;

    function validate() {
        return $("#frm").valid();
    };

    function get() {
        $.post("Sys/Handlers/Sys_BankHandler.ashx?type=get", { ID: "<%= WebHelper.Get("ID") %>" }, function (data) {
                $('#frm').fill(data);
            }, 'json');
        }

        $(function () {
            $("#frm").validate({
                errorElement: "span"
            });

            get();

            $("#frm").ajaxForm({
                dataType: 'json',
                beforeSubmit: function (arr, $form, options) {
                    if (flag) {
                        return false;
                    }
                    else {
                        flag = true;
                        return true;
                    }
                },
                success: function (data) {
                    if (data.isSuccess) {
                        loadPage("Sys/Sys_BankList.aspx");
                    }
                    else {
                        $(".alert > .content").html(data.message);
                        $(".alert").show();
                    }
                    flag = false;
                }
            });

            $("#btnCancel").click(function () {
                loadPage("Sys/Sys_BankList.aspx");				
            });
        });

</script>